<template>
    <div :class="{itembox:!chosen,chosenItem:chosen}" @click="clickhandler">
        <div class="icon"></div>
        <div>
            <ul class="content">
                <li class="text"><span>{{this.group==true?'(群)':' '}}{{ this.name }}</span></li>
                <li>{{ this.id }}</li>
            </ul>
        </div>
    </div>
</template>
<script>

export default {
    props:{
        id:{type:String},
        name:{type:String},
        group:{type:Boolean},
        chosen:{type:Boolean}
    },
    methods:{
        clickhandler(){
            let param = {
                id :this.id,
                name:this.name,
                group:this.group 
            }
            this.$emit("switchDialog",param)
        }
    }
}
</script>
<style scoped>
.itembox{
    display: flex;
    width:100%;
    height: 80px;
    background-color: rgba(234, 0, 0, 0);
    margin:6px 0;
    padding:4px;
    color:white;
}
.chosenItem{
    display: flex;
    width:120%;
    height: 80px;
    background-color: rgb(140, 242, 255);
    margin:6px 0;
    padding:4px;
    color:rgb(14, 52, 59) ;
}
.itembox:hover{
    transform: rotateY(15deg);
    background-color:rgb(100, 100, 100) ;
}
.text{
  font-size:30px;
}
/* 子元素需要根据父元素反向扭曲 */
.content{
    margin-left: 20px;
    transform: skewX(20deg);
}

</style>